﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace Polls {
	[Serializable]
	public class Poll {
		string    title       = "";
		string    description = "";
		string    disease     = "";
		ArrayList elements    = new ArrayList();

		public string Title {
			get {
				return title;
			}
			set {
				title = value;
			}
		}

		public string Description {
			get {
				return description;
			}
			set {
				description = value;
			}
		}

		public string Disease {
			get {
				return disease;
			}
			set {
				disease = value;
			}
		}

		[XmlArrayItem(typeof(Text)),
		 XmlArrayItem(typeof(SingleChoiceQuestion)),
		 XmlArrayItem(typeof(DropDownListQuestion)),
		 XmlArrayItem(typeof(MultipleChoiceQuestion)),
		 XmlArrayItem(typeof(OpenQuestion)),
		 XmlArrayItem(typeof(NumberQuestion))]
		public ArrayList Elements {
			get {
				return elements;
			}
			set {
				elements = value;
			}
		}
		
		public void AddElement(object obj) {
			Elements.Add(obj);
		}
	}
}
